package com.db.patterns.proxy.cglib_proxy;

import net.sf.cglib.proxy.Enhancer;


public class Client {
    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(Student.class);
        StudentIntercept studentIntercept = new StudentIntercept();
        enhancer.setCallback(studentIntercept);
        Student student = (Student) enhancer.create(new Class[]{String.class}, new Object[]{"小兵"});
        student.sendFlowers();
        student.sendToys();
    }
}
